#pragma once
#include "DXAMLCommon.h"
#include "CTimeline.h"


class CDependencyProperty;
class CTimeSpan;

class CDispatcherTimer :
	public CTimeline
{

protected: 
	CDispatcherTimer();
private: 
	CDispatcherTimer(CCoreServices * pCore);
	virtual ~CDispatcherTimer();
public: 
	static HRESULT Create(CDependencyObject * * ppObject, CREATEPARAMETERS * pCreate);
	HRESULT Stop();
	HRESULT Start();
	HRESULT WorkComplete();
	void FireTickEvent();
	virtual XUINT32 GetTypeIndex() const;
	virtual HRESULT AddEventListener(CDependencyProperty * pdp, CValue * pValue, XINT32 iListenerType, CValue * pResult, XINT32 fHandledEventsToo);
	virtual HRESULT RemoveEventListener(CDependencyProperty * pdp, CValue * pValue);
	virtual HRESULT ComputeStateImpl(const XFLOAT * pParentTime, XBOOL isParentInReverse, XFLOAT combinedSpeedRatio, struct IFrameScheduler * pFrameScheduler, XBOOL * pHasNoExternalReferences, XBOOL * pHasIndependentAnimation, XBOOL * pIsInReverse);
	virtual XBOOL ControlsManagedPeerLifetime();
	virtual XBOOL ParticipatesInManagedTreeInternal();
	CTimeSpan * m_pInterval;
	XFLOAT m_rLastTickTime;
	XUINT8 m_fAddedToManager;
	XUINT8 m_fRunning;
	XUINT8 m_fWorkPending;
};